/*
 * To change this template, choose Tools | Templates
 * and open. the template in the editor.
 */

/*
 * articulosListarGUI.java
 *
 * Created on 14/10/2011, 11:53:36
 */

package Ventas;

import java.awt.event.ActionListener;
import java.awt.event.KeyListener;

/**
 *
 * @author nan
 */
public class ventasListar extends javax.swing.JDialog {

    /** Creates new form articulosListarGUI */
    public ventasListar(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    public ventasListar(){
        initComponents();
    }

    public void setActionListeners(ActionListener lis){
        this.getjButtonMostrarTodos().addActionListener(lis);
        this.getjButtonMostrarFecha().addActionListener(lis);
        this.getjButtonMostrarVenta().addActionListener(lis);
        this.getjButtonEliminar().addActionListener(lis);
        this.getjButtonSalir().addActionListener(lis);

    }

    void setKeyListener(KeyListener lis) {
        this.getjTextFielDesdeFecha().addKeyListener(lis);
        this.getjTextFieldHastaFecha().addKeyListener(lis);
        this.getjTextFieldCantidadVentas().addKeyListener(lis);
        this.getjTextFieldTotalVendido().addKeyListener(lis);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        articulosListarGUI1 = new Articulo.articulosListarGUI();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jTextFielDesdeFecha = new javax.swing.JTextField();
        jTextFieldHastaFecha = new javax.swing.JTextField();
        jButtonMostrarTodos = new javax.swing.JButton();
        jButtonMostrarFecha = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTableVenta = new javax.swing.JTable();
        jButtonEliminar = new javax.swing.JButton();
        jButtonMostrarVenta = new javax.swing.JButton();
        jButtonSalir = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jTextFieldTotalVendido = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTextFieldCantidadVentas = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabelContado = new javax.swing.JLabel();
        jLabelTargeta = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabelgastoefec = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabeldTotalCaja = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Lista de Ventas");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Buscar Articulo"));

        jLabel1.setText("Desde Fecha ");

        jLabel2.setText("Hasta Fecha");

        jTextFielDesdeFecha.setFont(new java.awt.Font("Ubuntu", 0, 18));

        jTextFieldHastaFecha.setFont(new java.awt.Font("Ubuntu", 0, 18));

        jButtonMostrarTodos.setFont(new java.awt.Font("Ubuntu", 1, 18));
        jButtonMostrarTodos.setText("Mostrar Todos");

        jButtonMostrarFecha.setFont(new java.awt.Font("Ubuntu", 1, 18));
        jButtonMostrarFecha.setText("Mostrar Por Fecha");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextFieldHastaFecha)
                    .addComponent(jTextFielDesdeFecha, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButtonMostrarFecha, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonMostrarTodos, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextFielDesdeFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonMostrarTodos))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jTextFieldHastaFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonMostrarFecha))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTableVenta.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null}
            },
            new String [] {
                "IDVenta", "Total", "Cantidad Articulo", "Fecha", "TipoPago", "Nombre Usuario"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Double.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTableVenta);

        jButtonEliminar.setFont(new java.awt.Font("Ubuntu", 1, 18));
        jButtonEliminar.setText("Eliminar");

        jButtonMostrarVenta.setFont(new java.awt.Font("Ubuntu", 1, 18));
        jButtonMostrarVenta.setText("Mostrar Venta");

        jButtonSalir.setFont(new java.awt.Font("Ubuntu", 1, 18));
        jButtonSalir.setText("Salir");

        jLabel3.setText("Monto Total");

        jTextFieldTotalVendido.setFont(new java.awt.Font("Ubuntu", 0, 36));

        jLabel4.setText("Cantidad Ventas");

        jTextFieldCantidadVentas.setFont(new java.awt.Font("Ubuntu", 0, 18));

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Discriminado por"));

        jLabel5.setText("Contado:");

        jLabel6.setText("Tarjeta:");

        jLabelContado.setFont(new java.awt.Font("Ubuntu", 1, 18));
        jLabelContado.setText("----------");

        jLabelTargeta.setFont(new java.awt.Font("Ubuntu", 1, 18));
        jLabelTargeta.setText("---------");

        jLabel7.setText("Gastos:");

        jLabelgastoefec.setFont(new java.awt.Font("Ubuntu", 1, 18));
        jLabelgastoefec.setText("---------");

        jLabel9.setText("Total de Caja");

        jLabeldTotalCaja.setFont(new java.awt.Font("Ubuntu", 1, 36)); // NOI18N
        jLabeldTotalCaja.setText("-----------");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel9)
                            .addComponent(jLabel7)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabeldTotalCaja)
                            .addComponent(jLabelgastoefec)
                            .addComponent(jLabelContado)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addGap(18, 18, 18)
                        .addComponent(jLabelTargeta)))
                .addContainerGap(90, Short.MAX_VALUE))
            .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 335, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jLabelContado))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(jLabeldTotalCaja)))
                    .addComponent(jLabelgastoefec))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jLabelTargeta)))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addGap(40, 40, 40))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jTextFieldCantidadVentas, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldTotalVendido, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButtonSalir, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)
                    .addComponent(jButtonEliminar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)
                    .addComponent(jButtonMostrarVenta, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel3)
                                    .addComponent(jTextFieldTotalVendido, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 89, Short.MAX_VALUE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextFieldCantidadVentas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel4)))
                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addGap(20, 20, 20)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButtonMostrarVenta)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonEliminar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButtonSalir))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 254, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(19, 19, 19))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                ventasListar dialog = new ventasListar(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private Articulo.articulosListarGUI articulosListarGUI1;
    private javax.swing.JButton jButtonEliminar;
    private javax.swing.JButton jButtonMostrarFecha;
    private javax.swing.JButton jButtonMostrarTodos;
    private javax.swing.JButton jButtonMostrarVenta;
    private javax.swing.JButton jButtonSalir;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelContado;
    private javax.swing.JLabel jLabelTargeta;
    private javax.swing.JLabel jLabeldTotalCaja;
    private javax.swing.JLabel jLabelgastoefec;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTable jTableVenta;
    private javax.swing.JTextField jTextFielDesdeFecha;
    private javax.swing.JTextField jTextFieldCantidadVentas;
    private javax.swing.JTextField jTextFieldHastaFecha;
    private javax.swing.JTextField jTextFieldTotalVendido;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the articulosListarGUI1
     */
    public Articulo.articulosListarGUI getArticulosListarGUI1() {
        return articulosListarGUI1;
    }

    /**
     * @return the jButtonEliminar
     */
    public javax.swing.JButton getjButtonEliminar() {
        return jButtonEliminar;
    }

    /**
     * @return the jButtonMostrarFecha
     */
    public javax.swing.JButton getjButtonMostrarFecha() {
        return jButtonMostrarFecha;
    }

    /**
     * @return the jButtonMostrarTodos
     */
    public javax.swing.JButton getjButtonMostrarTodos() {
        return jButtonMostrarTodos;
    }

    /**
     * @return the jButtonMostrarVenta
     */
    public javax.swing.JButton getjButtonMostrarVenta() {
        return jButtonMostrarVenta;
    }

    /**
     * @return the jButtonSalir
     */
    public javax.swing.JButton getjButtonSalir() {
        return jButtonSalir;
    }

    /**
     * @return the jTableVenta
     */
    public javax.swing.JTable getjTableVenta() {
        return jTableVenta;
    }

    /**
     * @return the jTextFielDesdeFecha
     */
    public javax.swing.JTextField getjTextFielDesdeFecha() {
        return jTextFielDesdeFecha;
    }

    /**
     * @return the jTextFieldHastaFecha
     */
    public javax.swing.JTextField getjTextFieldHastaFecha() {
        return jTextFieldHastaFecha;
    }

    /**
     * @return the jTextFieldCantidadVentas
     */
    public javax.swing.JTextField getjTextFieldCantidadVentas() {
        return jTextFieldCantidadVentas;
    }

    /**
     * @return the jTextFieldTotalVendido
     */
    public javax.swing.JTextField getjTextFieldTotalVendido() {
        return jTextFieldTotalVendido;
    }

    /**
     * @return the jLabelContado
     */
    public javax.swing.JLabel getjLabelContado() {
        return jLabelContado;
    }

    /**
     * @return the jLabelTargeta
     */
    public javax.swing.JLabel getjLabelTargeta() {
        return jLabelTargeta;
    }

    /**
     * @return the jLabeldTotalCaja
     */
    public javax.swing.JLabel getjLabeldTotalCaja() {
        return jLabeldTotalCaja;
    }

    /**
     * @return the jLabelgastoefec
     */
    public javax.swing.JLabel getjLabelgastoefec() {
        return jLabelgastoefec;
    }

    

}
